package com.ffapp.rainmonitorcustom.bean;

import java.text.NumberFormat;

public class HomeInfoBean extends BasisBean {

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;


	/**
	 * todayAlarmCount : 0
	 * workflowCount : 0
	 * stcdCount : 0
	 * onlineNum : 0
	 * onlineRate : 0
	 * announceNum : 0
	 */

	private int todayAlarmCount;
	private int workflowCount;
	private int stcdCount;
	private int onlineNum;
	private String onlineRate;
	private int announceNum;

	public int getTodayAlarmCount() {
		return todayAlarmCount;
	}

	public void setTodayAlarmCount(int todayAlarmCount) {
		this.todayAlarmCount = todayAlarmCount;
	}

	public int getWorkflowCount() {
		return workflowCount;
	}

	public void setWorkflowCount(int workflowCount) {
		this.workflowCount = workflowCount;
	}

	public int getStcdCount() {
		return stcdCount;
	}

	public void setStcdCount(int stcdCount) {
		this.stcdCount = stcdCount;
	}

	public int getOnlineNum() {
		return onlineNum;
	}

	public void setOnlineNum(int onlineNum) {
		this.onlineNum = onlineNum;
	}

	public String getOnlineRate() {
		return onlineRate;
	}

	public void setOnlineRate(String onlineRate) {
		this.onlineRate = onlineRate;
	}

	public int getAnnounceNum() {
		return announceNum;
	}

	public void setAnnounceNum(int announceNum) {
		this.announceNum = announceNum;
	}
	public String getAlarmRate() {
        NumberFormat numberFormat = NumberFormat.getInstance();
        numberFormat.setMaximumFractionDigits(2);
        if(todayAlarmCount == 0 || stcdCount ==0){
        	return "0";
		}
        String result = numberFormat.format((float) todayAlarmCount / (float) stcdCount * 100);
        return result;
	}

}
